#include "block.h"
#include <fcntl.h>
#include <iostream>
#include <typeinfo>


Block::Block(FILE* _device, unsigned long _offset)
{
    device = _device;
    offset = _offset;
}

Block::~Block()
{
    //delete __struct;
}

void Block::read(void* data, unsigned long structSize)
{
    if(fseek(device, offset, SEEK_SET) < 0)
    {
        std::cout << "Seek failed at: " << offset << "\n";
        throw;
    }
    //cout << "Struct size: " << structSize << endl;
    //This made me like C++, woot, load a struct from file
    unsigned long read = (unsigned long)fread(data, structSize, 1, device);
}

void Block::print()
{
}
